//
//  ViewController.m
//  UIHomeWork03--Label_ImageView封装Button
//
//  Created by tusm on 16/7/19.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ViewController.h"
#import "ButtonImage.h"
#import "ButtonLabel.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    ButtonLabel *buttonLabel = [[ButtonLabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    buttonLabel.text = @"按钮";
    buttonLabel.textAlignment = NSTextAlignmentCenter;
    buttonLabel.backgroundColor = [UIColor greenColor];
    [self.view addSubview:buttonLabel];
    [buttonLabel.tap addTarget:self action:@selector(labelAction)];
    
    
    ButtonImage *imageView = [[ButtonImage alloc] initWithFrame:CGRectMake(10, 250, 300, 400)];
    imageView.image = [UIImage imageNamed:@"1234"];
    [self.view addSubview:imageView];
    [imageView.tap addTarget:self action:@selector(imageAction)];
}
- (void)labelAction {
    NSLog(@"label");
}

- (void)imageAction {
    NSLog(@"image");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
